//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __DDKIT_H__
#define __DDKIT_H__

#include <carerr.h>
#include <assert.h>
#include "ddktypes.h"


#ifdef __cplusplus
#define Extern_C extern "C"
#else
#define Extern_C extern
#endif //__cplusplus

#define CONV(PTR, EBUF)  ((PTR)((char*)EBUF->GetPayload()))
#define SETBUF(TYPE, NUM, EBUF) (EBUF->SetUsed(sizeof(TYPE) * NUM))
#define LOADBUF(EBUF) (EBUF->GetUsed())

#define CONV1(PTR, EBUF)  ((PTR)((char*)EBUF.GetPayload()))
#define SETBUF1(TYPE, NUM, EBUF) (EBUF.SetUsed(sizeof(TYPE) * NUM))
#define LOADBUF1(EBUF) (EBUF.GetUsed())

#define _MIN_(a,b) ((a)>(b)?(b):(a))
#define _MAX_(a,b) ((b)>(a)?(b):(a))

Extern_C ECode C_Sleep(uint_t uTicks);
Extern_C void C_Delay(uint_t uMicroseconds);
Extern_C void mdelay(uint_t uMillisecond);
Extern_C int cprintf(const char *, ...);

#endif


